<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>书籍信息</title>
<link rel="stylesheet" href="styles/layout.css" type="text/css" />
<script type="text/javascript" src="scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="scripts/jquery.slidepanel.setup.js"></script>
<script type="text/javascript">
	function borrow() {
		f = document.getElementById("btnpanel2")
		f.action = ""
		f.submit()
	}
</script>
</head>
<body>

	<%if(session.isNew()||session.getAttribute("username")==null
||session.getAttribute("username").toString()==""){%>
	<jsp:forward page="IndexAction"></jsp:forward>
	<%}%>
	<!-- 个人信息 -->
	<div class="wrapper col0">
		<div id="topbar">
			<div id="userinfopanel">
				<ul>
					<li class="left">你好，<%=session.getAttribute("username").toString() %></li>
					<li class="center"><a href="#">我的信息</a></li>
					<li class="right"><a href="/driftbook/IndexAction">注销登录</a></li>
				</ul>
			</div>
		</div>
	</div>
	<!--
########################################################################################## -->
	<div class="wrapper col1">
		<div id="header">
			<div id="logo">
				<a href="#"><img id="logoimg" src="images/logo_slat.jpg" /></a>
				<!--<p>漂书系统</p>-->
			</div>
			<div id="topnav">
				<ul>
					<li class="active"><a href="driftAfterLogin.jsp">首页</a></li>
					<li><a href="#">漂书</a></li>
					<li><a href="#">搜索</a></li>
					<li class="last"><a href="#">捐书</a></li>
				</ul>
			</div>
			<br class="clear" />
		</div>
	</div>
	<!--
########################################################################################## -->
	<div class="wrapper col2"></div>
	<!--
########################################################################################## -->
	<div class="wrapper col3">
		<div id="homecontent">
			<h1>书籍详细信息</h1>
			<div class="detailinfo">
				<div class="leftinfo">
					<img src="<%=request.getAttribute("picture")%>" />
					<% if(request.getAttribute("whether").toString()=="0") out.print("<div id=\"status\" class=\"red\">占有"); else out.print("<div id=\"status\" class=\"green\">空闲");%>
				</div>
			</div>
			<div class="rightinfo">
				<div id="titlebtn">
					<h2><%=request.getAttribute("bookname")%></h2>
					<form id="btnpanel2">
						<a id="borrow" class="btn" onClick="borrow()">我要借阅</a> <a
							id="return" class="btn" href="javascript:history.go(-1)">返回</a>
					</form>
				</div>
				<ul>
					<li>作者:<%=request.getAttribute("author")%></li>
					<li>ISBN:<%=request.getAttribute("isbn")%></li>
					<li>出版社:<%=request.getAttribute("publisher")%></li>
					<li>简介
						<p><%=request.getAttribute("about")%></p>
					</li>
				</ul>
			</div>
			<br class="clear" />
		</div>
		<hr />
		<div class="borrowhistory">
			<div id="borpanel" class="ctrlpanel">
				<h6>
					此书已漂
					<%=request.getAttribute("count1") %>次
				</h6>
				<a class="borhistabbtn" href="#borpanel">查看详细信息 ▼</a><a
					class="borhistabbtn" href="#borpanel" style="display: none;">收起详细信息
					▲</a>
			</div>
			<div id="borhistab" style="display: none;">
				<table>
					<thead>
						<tr>
							<th>用户
							</td>
							<th>借阅日期
							</td>
						</tr>
					</thead>
					<tbody>
						<% 	List<String>info1=(List<String>)request.getAttribute("username") ;
        		List<Date>info2=(List<Date>)request.getAttribute("applytime") ;
        	Iterator<String>itr1= info1.iterator();Iterator<Date>itr2= info2.iterator();
        	while(itr1.hasNext()&&itr2.hasNext()){
        %>
						<tr>
							<td><%=itr1.next()%></td>
							<td><%=itr2.next().toString().substring(0,10)%></td>
						</tr>
						<% }%>
					</tbody>
				</table>
			</div>
		</div>
		<div class="waithistory">
			<div id="waitpanel" class="ctrlpanel">
				<h6>
					此书待漂
					<%=request.getAttribute("count2") %>
					人
				</h6>
				<a class="waithistabbtn" href="#waitpanel">查看详细信息 ▼</a> <a
					class="waithistabbtn" href="#waitpanel" style="display: none;">收起详细信息
					▲</a>
			</div>
			<div id="waithistab" style="display: none;">
				<table>
					<thead>
						<tr>
							<th>用户
							</td>
							<th>借阅日期
							</td>
						</tr>
					</thead>
					<tbody>
						<% 	List<String>info11=(List<String>)request.getAttribute("username1") ;
        		List<Date>info22=(List<Date>)request.getAttribute("applytime1") ;
        	Iterator<String>itr11= info11.iterator();Iterator<Date>itr22= info22.iterator();
        	while(itr11.hasNext()&&itr22.hasNext()){
        %>
						<tr>
							<td><%=itr11.next()%></td>
							<td><%=itr22.next().toString().substring(0,10)%></td>
						</tr>
						<% }%>
					</tbody>
				</table>
			</div>
		</div>
	</div>
	</div>
	<!--
########################################################################################## -->
	<div class="wrapper col5">
		<div id="copyright">
			<p class="fl_left">
				Copyright &copy; 2012 - All Rights Reserved - <a href="#">Shanghai
					University Opensource Community</a>
			</p>
			<br class="clear" />
		</div>
	</div>
</body>
</html>
</body>
</html>